<template>
	<view class="mainbgc">
		<header-top :messageInfo="{typeFlag:true,message:'设置',liner:false}"></header-top>
		<view class="ffffff">
			<view class="mainpadding flexbetween neeedborder ffffff" @click="jumpurl('/pages/mypage/xiugaisjh')">
				<view class="nostrongtext">修改手机号</view>
				<view class="righticon2"></view>
			</view>
			<view class="mainpadding_top flexbetween neeedborder ffffff"
				@click="jumpurl('/pages/mypage/changepassword')">
				<view class="nostrongtext">修改密码</view>
				<view class="righticon2"></view>
			</view>
			<view class="mainpadding_top flexbetween neeedborder ffffff"
				@click="jumpurl('/pages/systempage/systempage?type=3')">
				<view class="nostrongtext">关于我们</view>
				<view class="righticon2"></view>
			</view>
			<view class="mainpadding_top flexbetween neeedborder ffffff"
				@click="jumpurl('/pages/systempage/systempage?type=1')">
				<view class="nostrongtext">使用协议</view>
				<view class="righticon2"></view>
			</view>
			<view class="mainpadding_top flexbetween neeedborder ffffff" @click="zxshow=true">
				<view class="nostrongtext">账号注销</view>
				<view class="righticon2"></view>
			</view>
			<view class="mainpadding_top flexbetween neeedborder ffffff">
				<view class="nostrongtext">版本号</view>
				<view class="nostrongtext">{{version}}</view>
			</view>
		</view>
		<view class="flexcenter">
			<view class="yesbtn" @click="show=true">退出登录</view>
		</view>
		<u-modal title='警告' :show="zxshow" content="账号注销后，您的系统数据将不再可用。请慎重处理!!!" @confirm="zxconfirm" style='text-align: center;' confirmColor="#999"
			confirmText="确认注销" cancelText="再想想" cancelColor="#00b855" buttonReverse showCancelButton
			@cancel='zxshow=false'></u-modal>
		<u-modal title='是否退出登录' content="" :show="show" @confirm="confirm" style='text-align: center;' showCancelButton
			@cancel='show=false'></u-modal>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				show: false,
				zxshow: false,
				version:"",
			}
		},
		onLoad() {
			let that = this
			// #ifdef APP-PLUS
			plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
				console.log(widgetInfo,"888");
				that.version = widgetInfo.version
			});  
			// #endif
		},
		methods: {
			confirm() {
				this.show = false;
				httpRequest.toast("退出登录成功");
				setTimeout(() => {
					// 将存储的数据改为空达到退出登录的效果
					uni.clearStorageSync()
					uni.reLaunch({
						url: "/pages/login/accountlogin"
					})
				}, 1000)
			},
			zxconfirm() {
				this.zxshow = false;
				httpRequest.request('/dhtapi/user/zxAccount', 'GET', {
				}, false, false, true).then(res => {
					httpRequest.toast(res.msg);
					if(res.code==1){
						setTimeout(() => {
							uni.reLaunch({
								url: "/pages/login/accountlogin"
							})
						}, 1000)
					}
				})
			},
			jumpurl(url) {
				uni.navigateTo({
					url: url
				})
			},
		}
	}
</script>

<style>

</style>